home *** CD-ROM | disk | FTP | other *** search
- property printButChannel, printButCover, pointList, pictList, firstPict, photoCount, sandboxChan, firstPictChan, pageNum, pictsPerPage, albumList, selectedPhoto, hiliteChan, trashChan, dragChan, firstLinePict, printButtonObject
- global gActorList, gMenuObject
-
- on birth me
- set firstPictChan to 2
- set hiliteChan to 8
- set sandboxChan to 11
- set printButChannel to 13
- set dragChan to 16
- set trashChan to 17
- set pictsPerPage to 6
- set firstLinePict to the number of cast "AlbumLineArt1"
- set printButCover to the number of cast "printCoverAlbum"
- set pointList to [point(195, 82), point(141, 200), point(195, 318), point(444, 82), point(498, 200), point(444, 318)]
- set firstPict to the number of cast "3dLoaderEtc"
- set pictList to ["3d.loaderEtc": 0, "3d.exca+grade": 0, "3d.sroller": 0, "VTL1": 0, "VTL2": 0, "VTL3": 0, "VTL4": 0, "VTL5": 0, "VTL6": 0, "VTL7": 0, "VTL8": 0, "VTL9": 0]
- set selectedPhoto to 0
- return me
- end
-
- on setup me
- add(gActorList, birth(script "Rollover Anim Button Class", "goMenu( gAlbumObject, me )", 11, 11, 5, "RCA-07VO01", "RCA-07RO01"))
- add(gActorList, birth(script "Rollover Anim Button Class", "help( gAlbumObject, me )", 12, 12, 11, EMPTY, "RCA-05RO02"))
- if the printEnabled of gMenuObject then
- set printButtonObject to birth(script "Rollover Anim Button Class", "print( gAlbumObject )", 13, 13, 5, "B713VO03", "B713RO03")
- if selectedPhoto > 0 then
- add(gActorList, printButtonObject)
- end if
- end if
- puppetSprite(hiliteChan, 1)
- end
-
- on predraw me
- set pageNum to 1
- updateAlbumList(me)
- drawPage(me, pageNum)
- if the printEnabled of gMenuObject = 0 then
- set the castNum of sprite printButChannel to printButCover
- set the locH of sprite printButChannel to 223
- set the locV of sprite printButChannel to 458
- puppetSprite(printButChannel, 1)
- end if
- end
-
- on selectPhoto me
- if (selectedPhoto = 0) and the printEnabled of gMenuObject then
- add(gActorList, printButtonObject)
- end if
- set selectedPhoto to the clickOn - firstPictChan + 1
- set hilitePoint to getAt(pointList, selectedPhoto)
- set the locH of sprite hiliteChan to getAt(hilitePoint, 1)
- set the locV of sprite hiliteChan to getAt(hilitePoint, 2)
- end
-
- on trashClick me
- if selectedPhoto > 0 then
- if pageNum = 1 then
- set albumPosition to selectedPhoto
- else
- set albumPosition to selectedPhoto + pictsPerPage
- end if
- trashLid(me, 1)
- set the locH of sprite hiliteChan to 1000
- animatePhoto(me, albumPosition)
- puppetSound("TRASHALB")
- trashLid(me, -1)
- set photoName to getPropAt(albumList, albumPosition)
- deleteAt(albumList, albumPosition)
- setProp(pictList, photoName, 0)
- set photoCount to count(albumList)
- if photoCount <= pictsPerPage then
- set pageNum to 1
- end if
- repeat while soundBusy(1)
- end repeat
- puppetSound(0)
- drawPage(me, pageNum)
- puppetTransition(51, 1)
- set selectedPhoto to 0
- if the printEnabled of gMenuObject then
- clearActor(printButtonObject)
- end if
- end if
- end
-
- on trashLid me, castDelta
- set the castNum of sprite trashChan to the castNum of sprite trashChan + castDelta
- updateStage()
- startTimer()
- repeat while the timer < 4
- end repeat
- set the castNum of sprite trashChan to the castNum of sprite trashChan + castDelta
- updateStage()
- end
-
- on animatePhoto me
- set channel to firstPictChan + selectedPhoto - 1
- set the castNum of sprite dragChan to the castNum of sprite channel
- set the locH of sprite dragChan to the locH of sprite channel
- set the locV of sprite dragChan to the locV of sprite channel
- removeSprite(channel)
- updateStage()
- puppetSprite(dragChan, 1)
- set scale to 1
- set width to the width of cast the castNum of sprite dragChan
- set height to the height of cast the castNum of sprite dragChan
- set the stretch of sprite dragChan to 1
- repeat while scale > 0.49000000000000005
- set the width of sprite dragChan to width * scale
- set the height of sprite dragChan to height * scale
- updateStage()
- set scale to scale - 0.01
- end repeat
- animateSprite(dragChan, point(64, 428), 5)
- removeSprite(dragChan)
- set the stretch of sprite dragChan to 0
- end
-
- on addPhoto me, photoName
- setProp(pictList, photoName, 1)
- updateAlbumList(me)
- end
-
- on updateAlbumList me
- set albumList to [:]
- repeat with photoNum = 1 to count(pictList)
- if getAt(pictList, photoNum) then
- addProp(albumList, getPropAt(pictList, photoNum), firstPict + photoNum - 1)
- end if
- end repeat
- set photoCount to count(albumList)
- end
-
- on flipPage me
- if pageNum = 1 then
- if photoCount > pictsPerPage then
- set pageNum to 2
- finishFlip(me)
- end if
- else
- set pageNum to 1
- finishFlip(me)
- end if
- end
-
- on finishFlip me
- set the locH of sprite hiliteChan to 1000
- puppetSound("pageturn")
- drawPage(me, pageNum)
- puppetTransition(1, 4)
- updateStage()
- set selectedPhoto to 0
- repeat while soundBusy(1)
- end repeat
- puppetSound(0)
- clearActor(printButtonObject)
- end
-
- on drawPage me, whichPage
- if whichPage = 1 then
- set firstAlbumPos to 1
- else
- set firstAlbumPos to pictsPerPage + 1
- end if
- repeat with pagePosition = 1 to pictsPerPage
- set albumPosition to firstAlbumPos + pagePosition - 1
- if albumPosition <= photoCount then
- drawPicture(me, pagePosition, albumPosition)
- next repeat
- end if
- drawPicture(me, pagePosition, 0)
- end repeat
- end
-
- on drawPicture me, pagePosition, albumPosition
- set channel to firstPictChan + pagePosition - 1
- if albumPosition = 0 then
- removeSprite(channel)
- else
- set photoPoint to getAt(pointList, pagePosition)
- set the locH of sprite channel to getAt(photoPoint, 1)
- set the locV of sprite channel to getAt(photoPoint, 2)
- set the castNum of sprite channel to getAt(albumList, albumPosition)
- end if
- puppetSprite(channel, 1)
- end
-
- on print me
- if selectedPhoto > 0 then
- if pageNum = 1 then
- set albumPosition to selectedPhoto
- else
- set albumPosition to selectedPhoto + pictsPerPage
- end if
- set photoName to getPropAt(albumList, albumPosition)
- set pictureNum to getPropPos(pictList, photoName)
- clearAllActors()
- unpuppetAll()
- keepSandboxBut(sandboxChan)
- puppetPalette("AlbumPal")
- go("Grass")
- go(the frame + 1)
- set the stageColor to 0
- puppetPalette("GrayScenePal", 60)
- updateStage()
- puppetPalette(0)
- unLoadCast()
- set lineArtPict to firstLinePict + pictureNum - 1
- set the castNum of sprite 7 to lineArtPict
- set the locH of sprite 7 to 320
- set the locV of sprite 7 to 230
- set the ink of sprite 7 to 0
- puppetSprite(7, 1)
- go("MASgray")
- printBitmap(lineArtPict)
- clearAllActors()
- unpuppetAll()
- puppetSprite(48, 1)
- puppetPalette("GrayScenePal")
- go("Grass")
- go(the frame + 1)
- set the stageColor to 255
- unLoadCast()
- predraw(me)
- puppetPalette("AlbumPal", 60)
- updateStage()
- puppetPalette(0)
- go("Album")
- puppetSprite(48, 0)
- set selectedPhoto to 0
- clearActor(printButtonObject)
- abort()
- else
- showAllActors()
- end if
- end
-
- on saveAlbum me
- set albumData to EMPTY
- repeat with x = 1 to count(pictList)
- set albumData to albumData & string(getAt(pictList, x)) & ","
- end repeat
- return albumData
- end
-
- on loadAlbum me, index
- repeat with x = 1 to count(pictList)
- setAt(pictList, x, value(item index of the dataString of gMenuObject))
- set index to index + 1
- end repeat
- return index
- end
-
- on goMenu me, buttonObject
- set selectedPhoto to 0
- clearAllActors()
- unpuppetAll()
- makeButtonJump(buttonObject)
- puppetPalette("AlbumPal")
- go("Grass")
- go(the frame + 1)
- unLoadCast()
- goLocationMap()
- end
-
- on help me, buttonObject
- birth(script "Help Parent", buttonObject, #Album)
- end
-